//-------------------------------------------------------------------------
// File: EnvironmentString.hpp
//
// Descr.: - todo -
//
// Author: Stefan Leihkauf
// Date:   28.07.2013
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
inline EnvironmentString::EnvironmentString()
{
}

//-------------------------------------------------------------------------
inline EnvironmentString::EnvironmentString(const KeyValuePair& keyValue) 
	:_keyvalue(keyValue) 
{
}

//-------------------------------------------------------------------------
inline EnvironmentString::EnvironmentString(const StdString& key, const StdString& value) 
{
	_keyvalue.first = key;
	_keyvalue.second = value;
}

//-------------------------------------------------------------------------
inline void EnvironmentString::set(const StdString& key, const StdString& value) 
{
	_keyvalue.first = key;
	_keyvalue.second = value;
}

//-------------------------------------------------------------------------
inline const EnvironmentString::KeyValuePair& EnvironmentString::get() const 
{
	return _keyvalue;
}

//-------------------------------------------------------------------------
inline const StdString& EnvironmentString::getName() const 
{
	return _keyvalue.first;
}

//-------------------------------------------------------------------------
inline void EnvironmentString::setName(const StdString& key) 
{
	_keyvalue.first = key;
}

//-------------------------------------------------------------------------
inline const StdString& EnvironmentString::getValue() const 
{
	return _keyvalue.second;
}

//-------------------------------------------------------------------------
inline void EnvironmentString::setValue(const StdString& value) 
{
	_keyvalue.second = value;
}

//-------------------------------------------------------------------------
inline bool EnvironmentString::operator == (const EnvironmentString& other) const 
{
	return (other._keyvalue == this->_keyvalue);
}

//-------------------------------------------------------------------------
inline bool EnvironmentString::operator != (const EnvironmentString& other) const 
{
	return (other._keyvalue != this->_keyvalue);
}

//-------------------------------------------------------------------------
inline StdString EnvironmentString::toString() const 
{
	if(_keyvalue.first.empty())
		return StdString(); // return empty string if key is empty

	return StdString(_keyvalue.first + _T("=") + _keyvalue.second);
}